//
//  BDDiscoverAnnotationView.m
//  BadBoy
//
//  Created by wen on 2017/3/25.
//  Copyright © 2017年 com.8xiong. All rights reserved.
//

#import "BDDiscoverAnnotationView.h"

@interface BDDiscoverAnnotationView ()


@end

@implementation BDDiscoverAnnotationView

-(id)initWithAnnotation:(id<MAAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier{
    if (self =[super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier]) {
        self.rightCalloutAccessoryView = self.button;
    }
    return self;
}

- (UILabel *)label{
    if (!_label) {
        self.label = [[UILabel alloc]initWithFrame:CGRectMake(0, 5, 53, 20)];
        _label.font = [UIFont systemFontOfSize:15];
        _label.textAlignment = NSTextAlignmentCenter;
        _label.textColor = [UIColor whiteColor];
        [self addSubview:_label];
    }
    return _label;
}

- (UIButton *)button{
    if (!_button) {
        self.button = [UIButton buttonWithType:UIButtonTypeCustom];
        _button.frame = CGRectMake(0, 0, 45, 30);
        [_button setTitle:ASLocalizedString(@"导航")forState:UIControlStateNormal];
        _button.titleLabel.font = [UIFont systemFontOfSize:13];
        [_button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _button.backgroundColor = KBDColorBlue;
        _button.layer.masksToBounds = YES;
        _button.layer.cornerRadius = 4;
    }
    return _button;
}

@end
